Release 10.1A: OpenEdge Development:
Web Services
Types of complex data
Complex data that you might need to access includes:
Complex data type parameters
If the Analyzer specifies that you can use a temp-table or ProDataSet to access a Web service parameter, you can access (for
OUTPUT) and write to (forINPUT) the parameter exactly as you do for any temp-table or ProDataSet parameter in the 4GL. If the Analyzer provides the temp-table or ProDataSet definition, you can use a static instance and specify the parameter as aTABLEorDATASET. If you must access the parameter as a dynamic temp-table or ProDataSet, you can specify the parameter as aTABLE-HANDLEorDATASET-HANDLE. For a dynamicOUTPUTparameter, OpenEdge ensures that the object is created and filled from the parameter element in the SOAP response message. For dynamicINPUTparameter, you must create and fill the object, as appropriate, before passing the parameter.For an
OUTPUTparameter that you access as a serialized XML string, you can work with serialized XML in theCHARACTERorLONGCHARparameter directly, using 4GL string-manipulation statements and functions, or work with it in its parsed form using the 4GL SAX reader or DOM parser. In any case, OpenEdge provides the entire<complexType>element for the value, exactly as it appears in the SOAP response message.For an
INPUTparameter that you write as a serialized XML string, you can build or maintain the value using the 4GL SAX writer or DOM parser, and save the result as aLONGCHARvalue when you are ready to pass it as anINPUTparameter to the Web service.For more information on using the SAX and DOM features in the 4GL, see OpenEdge Development: Programming Interfaces .
For an example of how to handle complex data parameters in the 4GL, see the "Complex data example" section.
Note: When you use the DOM parser to save the parsed XML as a serialized character string, the DOM parser adds a prolog element to the XML data intended for input to the Web service. OpenEdge automatically handles this prolog element when it inserts the intendedINPUTparameter value into the SOAP request message.The Progress 4GL recognizes and handles one SOAP convention using complex data elements in a manner that doesn’t necessarily require the parsing of XML in the 4GL. This SOAP convention is a special Document/Literal format developed by Microsoft known as document wrapped literal (Wrapped Doc/Lit) that uniquely wraps all request (input) parameters and all response (output) parameters together in separate outer elements.
The WSDL Analyzer recognizes and provides alternate forms of documentation for how to program Web service operations defined using Wrapped/Doc Lit in the 4GL. For more information on this documentation, see Chapter 8, " Analyzing WSDL for Progress 4GL Access to Web Services." For more information on the programming options supported by the 4GL for Wrapped Doc/Lit, see the "Coding options for wrapped document literal" section.
Complex data in SOAP headers and SOAP faults
You can also use techniques available for managing complex data parameters to access and manage the data for SOAP header entries and SOAP fault detail. You can get and set this data either as serialized character strings or as DOM trees. For more information, see Chapter 11 "Handling SOAP Message Headers in the Progress 4GL"and Chapter 12 "Handling Errors in Progress 4GL Requests to Web Services".
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |